<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> 需求列表 </title>

<?php include VIEWS.'admin/style.html'?>

<script type="text/javascript">
<!--
function toggleClassNames() {
  var n = this.className;
  this.className = this.altClassName;
  this.altClassName = n;
}

function setupDatarows() {
  var v = document.getElementsByTagName("tr");
  for (var i = 0; i < v.length; i++) {
    if (v[i].className.indexOf("datarow") != -1) {
      v[i].onmouseover = toggleClassNames;
      v[i].onmouseout = toggleClassNames;
      v[i].altClassName = v[i].className + " hover";
    }
  }
}

window.onload = setupDatarows;
//-->
</script>

</head>

<body>

<?php include VIEWS.'admin/head.html'?>

<ul id="submenu">
	<li><a href='items.php'>商品列表</a></li>
	<li><a href='itemsedit.php?add=1'>新增商品</a></li>
	<li><a href='itemscats.php'>商品分类</a></li>
    <li><a href='alert.php' class="current">商品需求</a></li>
</ul>

<div id="body">

<?php if ($list['detail']):?>

<h2>商品 “<?php echo $list['list'][0]['name']?>” 需求列表 - <?php echo $list['list'][0]['ct']?> 个用户</h2><br />

<table class="reportV2" cellpadding="5" width="50%" cellspacing="0" style="text-align:left;margin:0">
<tr class="columntitle"><td style="text-align:center" nowrap="">Email</td><td style="text-align:center" nowrap="">加入时间</td></tr>
<?php foreach ($list['detail'] as $item):?>
<tr><td style="text-align:center"><a href="mailto:<?php echo $item['email']?>"><?php echo $item['email']?></a></td><td><?php echo date('Y-m-d H:i', $item['created'])?></td></tr>
<?php endforeach?>
</table>

<?php else:?>

<table class="reportV2" cellpadding="5" width="98%" cellspacing="0">
<tr class="columntitle"><td style="text-align:center" width="5%" nowrap="">名次</td><td style="text-align:center" width="10%" nowrap=""><a href="alert.php?sort=iid">商品ID</a></td><td style="text-align:left"><a href="alert.php?sort=name">商品名</a></td><td><a href="alert.php?sort=ct">需求数量</a></td><td>操作</td></tr>

<?php if (count($list['list'])==0):?><tr><td colspan="9" style="text-align:left">暂时没有商品需求信息<td></tr><?php endif;?>

<?php
foreach($list['list'] as $item):
$list_i++;
?>
<tr class="<?php echo ($list_i % 2 ==0) ? 'even' : 'odd'?> datarow"><td style="text-align:center"><b><?php echo $list_i?></b></td><td style="text-align:center"><b><?php echo $item['iid']?></b></td><td style="text-align:left"><a href="/items.php/<?php echo $item['iid']?>" target="_blank"><?php echo $item['name']?></td></a><td><?php echo $item['ct']?></td><td><a href="alert.php?iid=<?php echo $item['iid']?>">查看详情</a></td></tr>
<?php endforeach;?>
</table>

<?php include VIEWS.'admin/pages.html'?>

<?php endif?>

<?php include VIEWS.'admin/runtime.html'?>

</div>

<script type="text/javascript">
Element.addClassName('am3', 'current');
</script>

</body>
</html>
